package com.my.okhttps.utils.security.util;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

import java.io.IOException;

/**
 * @author wyz02
 * @version 1.0
 * @ClassName Base64Util
 * @Description: TODO
 * @date 2021/1/26 11:36
 */
public class Base64Util {

    public static String encode(byte[] bytes){
        return new BASE64Encoder().encode(bytes);
    }

    public static byte[] decode(String encodeStr) throws IOException {
        return new BASE64Decoder().decodeBuffer(encodeStr);
    }

}
